<template>
  <div>
  </div>
</template>
<script>
import { utilJs } from "@/utils/common.js";
export default {
  name: 'TrainsitRoute', //有迹-私人订制-路由中转-跳转到支付页 （视频，音频，图文，专栏，vip/svip）
  components: {
  },
  data() {
    return {
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
    };
  },
  watch: {
    $route(to, form) {
    }
  },
  methods: {
  },
  activated() {
    this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
    if (utilJs.alertShopExpire(this, utilJs.getTimeByDate(this.companyAuth.expireTime))) return true;

    // prodType: 1:vip, 2:svip, 5:课程（视频，音频，图文）， 9：专栏

    let prodType = this.$route.query.prodType; //类型
    let id = this.$route.query.id; //id
    let youjiTag = this.$route.query.youjiTag; //id
    if (prodType == global.ckFrom.vip || prodType == global.ckFrom.svip) {
      //跳转到vip升级购买页
      let pathQuery = {
        "prodId": id,
        "type": prodType,
        "youjiTag": youjiTag
      };
      this.$routerGo(this, "replace", { path: "/member/vip/vipBuy", query: pathQuery });
    } else {
      let pathQuery = {
        "cId": prodType == global.ckFrom.course ? id : -1,
        "extId": prodType != global.ckFrom.course ? id : -1,
        "ckFrom": prodType,
        "isFromInvite": 0,
        "youjiTag": youjiTag
      };
      //跳转到购买页
      this.$routerGo(this, "replace", {
        path: "/homePage/course/coursePay",
        query: pathQuery
      });
    }
  }
}
</script>
<style scoped>
</style>
